<?php

require_once dirname(__FILE__).'/../lib/videoGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/videoGeneratorHelper.class.php';

/**
 * video actions.
 *
 * @package    sf_sandbox
 * @subpackage video
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class videoActions extends autoVideoActions {
	
	public function executeNew(sfWebRequest $request)
	{
		$this->form = $this->configuration->getForm();
		$this->video = $this->form->getObject();
		
		$this->form->setDefault('strtags', implode(',', $this->video->getTags()));
		$this->form->setDefault('cats', $this->video->getStrCategories() );
	}
	
	public function executeCreate(sfWebRequest $request)
	{
		$this->form = $this->configuration->getForm();
		$this->video = $this->form->getObject();
		$this->form->setDefault('strtags', implode(',', $this->video->getTags()));
		$this->form->setDefault('cats', $this->video->getStrCategories() );
		$this->processForm($request, $this->form);
	
		$this->setTemplate('new');
	}
	
	public function executeEdit(sfWebRequest $request)
	{
		
		$this->video = $this->getRoute()->getObject();
		$this->form = $this->configuration->getForm($this->video);
		$this->form->setDefault('strtags', implode(',', $this->video->getTags()));
		$this->form->setDefault('cats', $this->video->getStrCategories() );
	}
}
